#include"Com.hpp"
#include"Log.hpp"

int main()
{
    int fd = open(FIFO_FILE, O_WRONLY);
    if (fd < 0) 
    {
        perror("open");
        exit(FIFO_OPEN_ERR);
    }

    //
    cout << "client open file done" << endl;//成功打开客户端
    
    string line; //创建缓冲区
    
    while (true)
    {
        cout << "Please Entering#: ";
        getline(cin, line); //向缓冲去中写入数据

        write(fd, line.c_str(), line.size());
    }

    close(fd);
    return 0;
}